package com.yz.Graph;

import javax.swing.*;

//使用JFrame类创建窗口
public class GuiText07 {
    public static void main(String[] args) {

        JButton ok = new JButton("ok");
        JButton cancel = new JButton("Cancel");
        JLabel enter_your_name = new JLabel("Enter your name");
        JTextField type_name_here = new JTextField("Type name here");
        JCheckBox bold = new JCheckBox("Bold");
        JCheckBox italic = new JCheckBox("Italic");
        JRadioButton red = new JRadioButton("Red");
        JRadioButton yellow = new JRadioButton("Yellow");
        JComboBox jComboBox = new JComboBox(new String[]{"Freshman", "Sophomore", "Junior", "Senior"});
        JPanel jPanel = new JPanel();
        jPanel.add(ok);
        jPanel.add(cancel);
        jPanel.add(enter_your_name);
        jPanel.add(type_name_here);
        jPanel.add(bold);
        jPanel.add(italic);
        jPanel.add(red);
        jPanel.add(yellow);
        jPanel.add(jComboBox);



        JFrame jFrame1 = new JFrame();
        jFrame1.add(jPanel);
        //设置窗口名字
        jFrame1.setTitle("Windows1");
        //设置窗口大小
        jFrame1.setSize(800,500);
        //设置窗口左上角位置
        jFrame1.setLocation(800,300);
        //设置窗口关闭时退出程序
        jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //是否显示这个窗口
        jFrame1.setVisible(true);
    }
}
